//
//  AFDataBaseTools.h
//  AFFMDBTools_Example
//
//  Created by 张晓伟 on 2024/1/8.
//  Copyright © 2024 xywzxw. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface AFDBQryModel : NSObject
@property(nonatomic,assign)int page;
@property(nonatomic,assign)int rows;
/// 筛选条件
@property(nonatomic,copy)NSString *paramStr;

@end


@interface AFDataBaseTools : NSObject
/// 初始化FMDB服务，并始终开启数据库服务
/// - Parameter dbName: 数据库名称
+(void)configDataBaseWithDbName:(NSString *)dbName;

/// 设置key-value值
/// - Parameters:
///   - value: value值
///   - key: key值
+(BOOL)setValue:(NSString *)value withKey:(NSString *)key;

/// 通过key获取指定的value值
/// - Parameter key: key值
+(NSString *)getConfigValueWithKey:(NSString *)key;

/// 获取存储的所有key-value值
+(NSDictionary *)getAllConfigs;

/// 删除指定key的键值对
/// - Parameter key: key
+(BOOL)delConfigWithKey:(NSString *)key;

/// 清空所有key-value键值对
+(BOOL)clearAllConfig;

/// 插入数据
/// - Parameter model: 数据model
+(BOOL)insertModel:(NSObject *)model;

+(NSArray *)queryListWithModel:(NSObject *)model qry:(AFDBQryModel *)qry;

@end

NS_ASSUME_NONNULL_END
